﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BlogApi.ModelsDto;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BlogApi.Controllers
{
    [Route("api/staticResources")]
    [ApiController]
    public class StaticResourcesController : ControllerBase
    {
        public StaticResourcesController()
        {

        }
        [HttpGet]
        [Route("homeCarousel")]
#pragma warning disable CA1822 // Mark members as static
        public  IActionResult GetHomeCarousel()
#pragma warning restore CA1822 // Mark members as static
        {
            List<CarouselDto> listData = new List<CarouselDto>();
            for(int i = 1; i <= 6; i++)
            {
                listData.Add(new CarouselDto()
                {
                    ImgUrl = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/homeCarousel/carousel" + i.ToString() + ".jpg",
                    ExtraData = "额外其他数据"
                });
            }
            return new JsonResult(new
            {
                code = 0,
                carouselList = listData
            });
        }
        [HttpGet]
        [Route("musicData")]
#pragma warning disable CA1822 // Mark members as static
        public IActionResult GetMusicData()
#pragma warning restore CA1822 // Mark members as static
        {
            List<MusicDataDto> data = new List<MusicDataDto>
            {
                new MusicDataDto()
                {
                    Title = "1 + 1",
                    Artist = "doriko",
                    Src = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/1%2B1/doriko%20-%20%EF%BC%91%EF%BC%8B%EF%BC%91.mp3",
                    Pic = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/1%2B1/1409573914690118.jpg",
                    Lrc = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/1%2B1/1%2B1.lrc"
                },
                new MusicDataDto()
                {
                    Title = "All Alone With You",
                    Artist = "EGOIST",
                    Src = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/All%20Alone%20With%20You/EGOIST%20-%20All%20Alone%20With%20You.mp3",
                    Pic = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/All%20Alone%20With%20You/7823025232375393.jpg",
                    Lrc = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/All%20Alone%20With%20You/All%20Alone%20With%20You.lrc"
                },
                new MusicDataDto()
                {
                    Title = "Drifting Soul",
                    Artist = "Jen Bird",
                    Src = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/Drifting%20Soul/Jen%20Bird%20-%20Drifting%20Soul.mp3",
                    Pic = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/Drifting%20Soul/109951163312431204.jpg",
                    Lrc = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/Drifting%20Soul/Drifting%20Soul.lrc"
                },
                new MusicDataDto()
                {
                    Title = "Horizon",
                    Artist = "Clean Tears",
                    Src = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/Horizon/Clean%20Tears%20-%20Horizon.mp3",
                    Pic = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/Horizon/109951163518307282.jpg",
                    Lrc = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/Horizon/Horizon.lrc"
                },
                new MusicDataDto()
                {
                    Title = "One Last You",
                    Artist = "Jen Bird",
                    Src = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/One%20Last%20You/Jen%20Bird%20-%20One%20Last%20You.mp3",
                    Pic = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/One%20Last%20You/109951163312431204.jpg",
                    Lrc = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/One%20Last%20You/One%20Last%20You.lrc"
                },
                new MusicDataDto()
                {
                    Title = "Take Over",
                    Artist = "Lyn",
                    Src = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/Take%20Over/Lyn%20-%20Take%20Over.mp3",
                    Pic = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/Take%20Over/109951164483983989.jpg",
                    Lrc = "https://hatsune-miku-yyy-blog-static.oss-cn-chengdu.aliyuncs.com/music/Take%20Over/Take%20Over.lrc"
                }
            };
            return new JsonResult(new
            {
                code = 0,
                musicDataList = data
            });
        }
    }
}